<template>
    <div class="xinxi">
        <p class="carxin">车辆信息</p>
        <div>
            <div>
                <img src="../../../assets/dingdanxinxi/car.jpg" alt=""/>
            </div>
            <div>
                <p>{{ carName==null? this.$store.state.carinfo.carName :carName}}</p>
                <p>
                    <!-- <span>SUV</span>-->

                    <span>排量:{{this.carConfig.displacement}}(L)</span>
                    <i>|</i>
                    <span v-if="this.carConfig.speedBox === 1 ">自动</span>
                    <span v-if="this.carConfig.speedBox === 0 ">手动</span>
                    <i>|</i>
                    <span>可乘坐{{this.carConfig.seating}}人</span>
                </p>
            </div>
        </div>
    </div>
</template>
<style scoped lang="less">
    .xinxi {
        width: 95%;
        margin: 0 auto;
        height: 2.61rem;
        background: white;
        margin-top: 0.2rem;
        padding-top: 0.26rem;
        border-radius: 0.08rem;
        .carxin {
            width: 100%;
            height: 0.5rem;
            font-size: 0.29rem;
            font-weight: 600;
            padding-left: 0.34rem;
            margin-bottom: 0.08rem;
        }
        div {
            width: 100%;
            height: 1.3rem;
            display: flex;
            div:nth-child(1) {
                width: 2.85rem;
                height: 100%;
                display: flex;
                justify-content: center;
                img {
                    width: 2.2rem;
                    height: 100%;
                }
            }
            div:nth-child(2) {
                flex: 1;
                display: flex;
                flex-direction: column;
                justify-content: space-evenly;
                p:nth-child(1) {
                    width: 100%;
                    font-size: 0.34rem;
                    font-weight: 600;
                }
                p:nth-child(2) {
                    span {
                        font-size: 0.26rem;
                        color: #999999;
                        margin-right: 0.2rem;
                        line-height: 0.41rem;
                    }
                    i {
                        font-size: 0.27rem;
                        color: #dddddd;
                        margin-right: 0.2rem;
                    }
                }
            }
        }
    }
</style>
<script>
    import {queryCarConfigByConfigId} from "../../../request/userinfo/userinfo";

    export default {
        props: {
            carName: null,
        },
        data() {
            return {
                carConfig: {
                    speedBox: '',// 变速箱
                    displacement: '',//排量
                    seating: '',//座位数
                }
            };
        },
        mounted() {
            queryCarConfigByConfigId(this.$store.state.configId).then((res) => {
                this.carConfig = res.t;
            });
        }
    }
</script>